-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add codespell support (config, workflow to detect/not fix) and make it fix few typos #23398
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I am fine with having codespell in CI but you properly want to wait for feedback from other maintainers first before spending more time on this in case others do not like it
.github/workflows/codespell.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use github actions for the most part so please delete that.
If we want to enforce this on CI it must run in cirrus as part of make validate-sources, given you already hooked this into pre-commit this is already the case so it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will
- delete GH action
- add a TEMP commit with a typo to ensure they do get detected with pre-commit (will take PR into draft for the duration of TEMP commit presence).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently both "Cirrus CI / Windows Cross" and "Cirrus CI / Validate source code changes" ran pre-commit and failed on codespell
. As the point of test catching new typos is fulfilled, I will remove TEMP commit now and take out of draft.
pyproject.toml
Outdated
@@ -13,3 +13,10 @@ exclude = ''' | |||
| hack | |||
)/ | |||
''' | |||
|
|||
[tool.codespell] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that, it feels totally arbitrary to put this unrelated configuration in a python config file.
I recommend to use .codespellrc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you. I am even a little on your side since then it would not require optional tomli
.
Just 1 more chance to reconsider under the following arguments
- often people prefer avoiding pollution of root directory with per-tool configuration files.
- you already have the one (and only content)
tool.black
in pyproject.toml- FWIW codespell is written in Python , if argument "black is written in Python" comes up ;-)
So let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this in a random python file, we are not a python project so please remove it from there. I don't think anyone will ever look into this file ever and fine the codespell config there.
I like this alot, thanks @yarikoptic. Fix the couple of issues @Luap99 found, and I will give it a LGTM |
Also if you repush can you please fix up the commit messages for the |
I would be fine with just merging the commits into one PR. |
FWIW: I can easily adjust short commit message and can remove internal record on how the modification was made (some humans are curious creatures and actually do like to see command line invocation which resulted in the committed diff... More on With that in mind, just tell me final verdict of
|
0cca676
to
acf2328
Compare
acf2328
to
bee2654
Compare
LGTM |
I am reading commit message and this random stuff just wastes every readers time trying to make sense of this and why it is there. Please just squash the codespell fixes in a commit and name it something like fix issues reported by codespell or something like this. |
@@ -309,7 +309,7 @@ test/version/version: version/version.go | |||
|
|||
.PHONY: codespell | |||
codespell: | |||
codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"*.fish,RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L ddress,secon,passt,bu,hastable,te,clos,ans,pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether,specif -w | |||
codespell -w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would help to add a comment here saying where the new config is for authors used to edit the rules here inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment
bee2654
to
b09f38d
Compare
|
A friendly reminder that this PR had no activity for 30 days. |
@yarikoptic still working on this? Looks like all it needs is to adjust the commit message. |
…kefile Signed-off-by: Yaroslav Halchenko <[email protected]>
Signed-off-by: Yaroslav Halchenko <[email protected]>
Signed-off-by: Yaroslav Halchenko <[email protected]>
b09f38d
to
c203c48
Compare
Well, I thought I was done with it! ;) now spotted that failed CI apparently complaining about overly long subject line!
ok,
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, yarikoptic The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thanks @yarikoptic |
ae14dff
into
containers:main
codespell is not new to this project but not really part of the automated workflow(s) (precommit, CI).
There is
Makefile
rule but had hardcoded settings into it, so people had to usemake
and could notpre-commit
or directly -- I moved configuration intopyproject.yaml
so now if you have codespell (and tomli) installed - you can just codespell.CI workflow has 'permissions' set only to 'read' so also should be safe.
Also added pre-commit hook for it so no new typos would sneak in.
attn @rhatdan as I believe the codespell user ;)